package com.firefly.admin.workbench.controller;

import com.firefly.admin.common.annotations.annotation.OperationLog;
import com.firefly.admin.common.enums.OperationModuleEnum;
import com.firefly.admin.common.enums.OperationTypeEnum;
import com.firefly.admin.common.vo.Result;
import com.firefly.admin.workbench.entity.FySystemShortcutMenu;
import com.firefly.admin.workbench.service.FySystemShortcutMenuService;
import com.firefly.admin.workbench.vo.ShortcutMenuUpdateVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "工作台快捷菜单接口API")
@RestController
@RequestMapping("/workbench/shortcut/menu")
public class FySystemShortcutMenuController {

    @Autowired
    private FySystemShortcutMenuService fySystemShortcutMenuService;

    /**
     * 查询工作台快捷菜单列表接口
     *
     * @return 列表
     */
    @ApiOperation(value = "查询工作台快捷菜单列表接口", notes = "查询工作台快捷菜单列表接口", httpMethod = "GET")
    @GetMapping("/list")
    public Result<List<FySystemShortcutMenu>> getShortcutMenuList() {
        return fySystemShortcutMenuService.getShortcutMenuList();
    }

    /**
     * 工作台快捷菜单信息新增接口
     *
     * @param shortcutMenuUpdateList 快捷菜单信息
     * @return 操作结果
     */
    @ApiOperation(value = "工作台快捷菜单信息新增接口", notes = "工作台快捷菜单信息新增接口", httpMethod = "POST")
    @OperationLog(module = OperationModuleEnum.WORKBENCH, operateType = OperationTypeEnum.WORKBENCH_SHORTCUT_MENU, operateDesc = "工作台快捷菜单新增")
    @PostMapping("/update")
    public Result<String> update(@RequestBody List<ShortcutMenuUpdateVo> shortcutMenuUpdateList) {
        return fySystemShortcutMenuService.update(shortcutMenuUpdateList);
    }
}
